package demo1223.io;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Demo_2 {
    public static void main(String[] args) {
        try {
            FileWriter fileWriter = new
            FileWriter(new File("a.html"));
            fileWriter.write("绿蚁新焙酒");
            fileWriter.write("\n");
            fileWriter.write("红泥小火炉");
            fileWriter.write("\n");
            fileWriter.write("晚来天欲雪");
            fileWriter.write("\n");
            fileWriter.write("能饮一杯无");
            fileWriter.flush();
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
